<template>
  <div class="_m__11">
    <div class="_m__11_name">{{$t("open.result.hadOpen")}}</div>
    <div class="_main_2">
      <div v-for="{heroName,level,levelCombatPower, color, hero, id} in params" :key="id">
        <img :src="modules['/src/assets/Hero/' + color +'.png'].default" alt="" class="bg"/>
        <img :src="modules['/src/assets/Hero/' + color +'/'+ hero + '.png'].default" alt="" />
        <div class="_img_name">{{heroName}}</div>
        <div class="_img_level">{{$t("starBegin")}}{{level}}{{$t("star")}}</div>
        <div class="_img_zl">{{$t("power")}}{{levelCombatPower}}</div>
      </div>
    </div>
    <button class="union_join" @click="close">{{$t("confirm")}}</button>
  </div>
</template>

<script>

  const modules = import.meta.globEager("/src/assets/Hero/**");

  export default {
    props: {
      params: {
        type: Object,
        default: []
      }
    },
    data(){
      return {
        modules: modules,
      }
    },
    methods: {
      close: function(){
        this.$store.commit('changeOverlay', false)
        this.$router.back();
      }
    }
  }

</script>

<style scoped lang="scss">
  ._m__11 {
    width: 345px;
    height: 500px;
    background: #48423D;
    border-radius: 5px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 49px;
    padding: 20px 10px;
    font-size: 0;
  }

  ._m__11_name {
    font-size: 20px;
    @include fontTCMedium;
    font-weight: 500;
    color: $color;
  }

  ._main_2 {
    height: 350px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 24px;
    font-size: 0;
    @include flex;
    align-items: flex-start;
    overflow-y: scroll;

    > div {
      margin-bottom: 10px;
      position: relative;

      img {
        height: 218px;
        width: 150px;
        &.bg{
          position: absolute;
          width:150px;
          height:218px;
          top:0;
          left: 0;
          z-index: 100;
        }
      }
    }
  }

  ._img_name {
    width: 64px;
    height: 26px;
    border-radius: 3px;
    border: 1px solid $color3;
    font-size: 12px;
    @include fontSCRegular;
    color: $color3;
    line-height: 26px;
    margin: 10px auto;
  }

  ._img_level {
    position: absolute;
    font-size: 9px;
    @include fontSCRegular;
    font-weight: 400;
    color: #FFFFFF;
    width: 40px;
    height: 20px;
    line-height: 20px;
    background: rgba(0, 0, 0, .79);
    border-radius: 8px;
    top: 15px;
    right: 15px;
  }

  ._img_zl {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    @include fontSCRegular;
    font-weight: 400;
    color: #FFB522;
    width: 120px;
    height: 25px;
    background: rgba(0, 0, 0, .79);
    border-radius: 8px;
    line-height: 25px;
    top: 175px;
    white-space: nowrap;
  }
  .union_join {
    width: 315px;
    height: 44px;
    background: $color;
    border-radius: 5px;
    font-size: 17px;
    @include fontSCRegular;
    font-weight: 400;
    color: #0B0B09;
    line-height: 44px;
    margin-top: 20px;
  }
</style>
